﻿using PBMessage;
using UnityEngine;
using System.Collections;

public class MatchPlayerItem : MonoBehaviour {
	public GameObject LoadView;
	public GameObject HaveInfo;
	public UILabel UserIdLabel;
	public UILabel UserNameLabel;
	public UILabel UserLevelLabel;
	public GameObject IsReadyFlag;

	public void InitItem(ReadRoomPlayer data)
	{
		LoadView.gameObject.SetActive(false);
		HaveInfo.gameObject.SetActive(true);
		UserIdLabel.text = data.Account;
		UserNameLabel.text = data.NickName;
		UserLevelLabel.text = data.Account;
		if(data.IsReady)
		{
			IsReadyFlag.gameObject.SetActive(true);
		}
		else
		{
			IsReadyFlag.gameObject.SetActive(false);
		}
	}
}
